// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdCountry
 */
public class AdCountryDaoImpl
    extends org.tinaelle.server.domain.AdCountryDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdCountryDao#toAdCountryDTO(org.tinaelle.server.domain.AdCountry)
     */
    public org.tinaelle.common.dto.AdCountryDTO toAdCountryDTO(final org.tinaelle.server.domain.AdCountry entity)
    {
        return super.toAdCountryDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdCountry loadAdCountryFromAdCountryDTO(org.tinaelle.common.dto.AdCountryDTO adCountryDTO)
    {
        org.tinaelle.server.domain.AdCountry adCountry = this.load(adCountryDTO.getAdCountryId());
        if (adCountry == null)
        {
            adCountry = org.tinaelle.server.domain.AdCountry.Factory.newInstance();
        }
        return adCountry;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdCountryDao#adCountryDTOToEntity(org.tinaelle.common.dto.AdCountryDTO)
     */
    public org.tinaelle.server.domain.AdCountry adCountryDTOToEntity(org.tinaelle.common.dto.AdCountryDTO adCountryDTO)
    {
        org.tinaelle.server.domain.AdCountry entity = this.loadAdCountryFromAdCountryDTO(adCountryDTO);
        this.adCountryDTOToEntity(adCountryDTO, entity, true);
        return entity;
    }
}